package com.ruoyi.project.system.domain.dto;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.io.Serializable;

/**
 * 系统DTO类（请求字段名改为identity，适配前端传参）
 */
public class SystemDTO implements Serializable {
    private static final long serialVersionUID = 1L;

    // 1. 患者身份标识请求DTO（核心修改：字段名从patientIdentityNumber改为identity）
    public static class PatientIdentityRequest implements Serializable {
        @NotBlank(message = "患者身份标识号不能为空")
        private String identity; // 前端传参字段名：identity（原patientIdentityNumber）

        public String getIdentity() { return identity; }
        public void setIdentity(String identity) { this.identity = identity; }
    }

    // 2. 药品详情响应DTO（不变）
    public static class MedicineDetailResponse implements Serializable {
        private String medicineId;              // 药品ID（String格式）
        private String medicineName;            // 药品名称
        private BigDecimal medicinePrice;       // 药品价格
        private String medicineSpecification;   // 药品规格
        private String medicineUsageMethod;     // 药品使用方法
        private Integer medicineQuantity;        // 药品数量

        // Getter 和 Setter（不变）
        public String getMedicineId() { return medicineId; }
        public void setMedicineId(String medicineId) { this.medicineId = medicineId; }
        public String getMedicineName() { return medicineName; }
        public void setMedicineName(String medicineName) { this.medicineName = medicineName; }
        public BigDecimal getMedicinePrice() { return medicinePrice; }
        public void setMedicinePrice(BigDecimal medicinePrice) { this.medicinePrice = medicinePrice; }
        public String getMedicineSpecification() { return medicineSpecification; }
        public void setMedicineSpecification(String medicineSpecification) { this.medicineSpecification = medicineSpecification; }
        public String getMedicineUsageMethod() { return medicineUsageMethod; }
        public void setMedicineUsageMethod(String medicineUsageMethod) { this.medicineUsageMethod = medicineUsageMethod; }
        public Integer getMedicineQuantity() { return medicineQuantity; }
        public void setMedicineQuantity(Integer medicineQuantity) { this.medicineQuantity = medicineQuantity; }
    }

    // 3. 处方建议响应DTO（不变）
    public static class PrescriptionSuggestionResponse implements Serializable {
        private String prescriptionId;          // 处方ID（新增，方便前端识别）
        private String patientSymptoms;         // 患者症状
        private String prescriptionDescription; // 处方描述
        private String sportsSuggestion;        // 运动建议（选择模式）
        private String dietSuggestion;          // 饮食建议（选择模式）
        private String sleepSuggestion;         // 睡眠建议（选择模式）
        private String otherCustomSuggestion;   // 其他自定义建议（手写模式）

        // Getter 和 Setter（不变）
        public String getPrescriptionId() { return prescriptionId; }
        public void setPrescriptionId(String prescriptionId) { this.prescriptionId = prescriptionId; }
        public String getPatientSymptoms() { return patientSymptoms; }
        public void setPatientSymptoms(String patientSymptoms) { this.patientSymptoms = patientSymptoms; }
        public String getPrescriptionDescription() { return prescriptionDescription; }
        public void setPrescriptionDescription(String prescriptionDescription) { this.prescriptionDescription = prescriptionDescription; }
        public String getSportsSuggestion() { return sportsSuggestion; }
        public void setSportsSuggestion(String sportsSuggestion) { this.sportsSuggestion = sportsSuggestion; }
        public String getDietSuggestion() { return dietSuggestion; }
        public void setDietSuggestion(String dietSuggestion) { this.dietSuggestion = dietSuggestion; }
        public String getSleepSuggestion() { return sleepSuggestion; }
        public void setSleepSuggestion(String sleepSuggestion) { this.sleepSuggestion = sleepSuggestion; }
        public String getOtherCustomSuggestion() { return otherCustomSuggestion; }
        public void setOtherCustomSuggestion(String otherCustomSuggestion) { this.otherCustomSuggestion = otherCustomSuggestion; }
    }

    // 4. 单条预约完整响应DTO（不变）
    public static class SingleReservationResponse implements Serializable {
        // 预约基础信息
        private String reservationId;                  // 预约ID（唯一标识）
        private String patientName;                    // 患者姓名
        private String patientPhoneNumber;             // 患者联系电话
        private String attendingDoctorName;            // 主治医生姓名
        private Date prescriptionCreateTime;           // 处方创建时间（预约时间）
        private Date medicineDistributionTime;         // 药品分发时间
        private String departmentName;                 // 所属科室名称
        // 关联信息（单条预约对应1条处方+1条建议+多条药品）
        private PrescriptionSuggestionResponse prescriptionSuggestion; // 处方+建议
        private List<MedicineDetailResponse> medicineDetailList;         // 多药品列表

        // Getter 和 Setter（不变）
        public String getReservationId() { return reservationId; }
        public void setReservationId(String reservationId) { this.reservationId = reservationId; }
        public String getPatientName() { return patientName; }
        public void setPatientName(String patientName) { this.patientName = patientName; }
        public String getPatientPhoneNumber() { return patientPhoneNumber; }
        public void setPatientPhoneNumber(String patientPhoneNumber) { this.patientPhoneNumber = patientPhoneNumber; }
        public String getAttendingDoctorName() { return attendingDoctorName; }
        public void setAttendingDoctorName(String attendingDoctorName) { this.attendingDoctorName = attendingDoctorName; }
        public Date getPrescriptionCreateTime() { return prescriptionCreateTime; }
        public void setPrescriptionCreateTime(Date prescriptionCreateTime) { this.prescriptionCreateTime = prescriptionCreateTime; }
        public Date getMedicineDistributionTime() { return medicineDistributionTime; }
        public void setMedicineDistributionTime(Date medicineDistributionTime) { this.medicineDistributionTime = medicineDistributionTime; }
        public String getDepartmentName() { return departmentName; }
        public void setDepartmentName(String departmentName) { this.departmentName = departmentName; }
        public PrescriptionSuggestionResponse getPrescriptionSuggestion() { return prescriptionSuggestion; }
        public void setPrescriptionSuggestion(PrescriptionSuggestionResponse prescriptionSuggestion) { this.prescriptionSuggestion = prescriptionSuggestion; }
        public List<MedicineDetailResponse> getMedicineDetailList() { return medicineDetailList; }
        public void setMedicineDetailList(List<MedicineDetailResponse> medicineDetailList) { this.medicineDetailList = medicineDetailList; }
    }

    // 5. 最终响应DTO（不变）
    public static class AllReservationsResponse implements Serializable {
        private List<SingleReservationResponse> reservationList; // 所有预约记录
        private Integer total;                                   // 总条数（方便前端分页）

        // Getter 和 Setter（不变）
        public List<SingleReservationResponse> getReservationList() { return reservationList; }
        public void setReservationList(List<SingleReservationResponse> reservationList) { this.reservationList = reservationList; }
        public Integer getTotal() { return total; }
        public void setTotal(Integer total) { this.total = total; }
    }
}